package com.yuntsg.nnsfcp.service.front.ut;

import javax.servlet.http.HttpServletRequest;

/**
 * ip 处理
 *
 * @author ：ljx
 * @date ：Created in 2019/9/18
 */
public class IpUtil {


    /**
     * 得到当前请求的ip地址
     *
     * @param request
     * @return
     */
    public static String getIp(HttpServletRequest request) {
        return request.getRemoteAddr();
    }


    /**
     * 检查ip是否属于校内
     *
     * @param ip 请求者的ip地址
     * @return
     */
    public static boolean checkIp(String ip) {
        String scope = "220.115.183.130";
        if (scope.equals(ip)) {
            return true;
        }
        return false;
    }

}
